package cn.afterturn.easypoi.word.entity.bookmark;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/*@Data
@ToString(callSuper = true)
@EqualsAndHashCode()*/
@Table(name = "tableEntityVO", schema = "jeecg-boot-sjk", catalog = "")
@Entity
public class TableEntityVO {
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getTableSequence() {
        return tableSequence;
    }

    public void setTableSequence(int tableSequence) {
        this.tableSequence = tableSequence;
    }

    public String getTableText() {
        return tableText;
    }

    public void setTableText(String tableText) {
        this.tableText = tableText;
    }

    public String getTableHashcode() {
        return tableHashcode;
    }

    public void setTableHashcode(String tableHashcode) {
        this.tableHashcode = tableHashcode;
    }

    public Set<RowEntityVO> getRowEntityVOS() {
        return rowEntityVOS;
    }

    public void setRowEntityVOS(Set<RowEntityVO> rowEntityVOS) {
        this.rowEntityVOS = rowEntityVOS;
    }

    public WordEntityVO getWordEntityVO() {
        return wordEntityVO;
    }

    public void setWordEntityVO(WordEntityVO wordEntityVO) {
        this.wordEntityVO = wordEntityVO;
    }
    @ApiModelProperty(value = "系统解析是自动生成ID")
    @Id
    @Column(name = "id")

    private String id;
    @ApiModelProperty(value = "表在文档中是顺序")
    private int tableSequence;
    @ApiModelProperty(value = "表格的内容")
    private String tableText;
    @ApiModelProperty(value = "表格的hashcode")
    private String tableHashcode;
    @ApiModelProperty(value = "表格中的行记录")
    @JsonIgnoreProperties("tableEntityVO")
    @OneToMany(mappedBy = "tableEntityVO",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    //@org.hibernate.annotations.ForeignKey(name = "none")
    private Set<RowEntityVO> rowEntityVOS=new HashSet<>();

    @JsonIgnoreProperties("tableEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "fid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private WordEntityVO wordEntityVO;


}
